package com.dyw.blog.dao.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dyw.blog.dao.entity.Tag;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Devil
 * @create 2022-02-10 16:15
 */
public interface TagMapper extends BaseMapper<Tag> {
    //@Select("select id, avatar,tag_name from ms_tag where id in (select tag_id from ms_article_tag where article_id=#{articleId})")
    List<Tag> findTagsByArticleId(Long articleId);

    /**
     * 查询最热的标签 前n条
     *
     * @param limit
     * @return
     */
    List<Integer> findHotsTagIds(int limit);



    List<Tag> findTagsByTagsIds(List<Integer> tagIds);
}